import React, { Component, PropTypes } from 'react'
import PayInfo from "containers/expense-report/template/pay-info";

class SlideExpenseReportDetailPay extends Component {

  static contextTypes = {
    info: PropTypes.object,
    applicant: PropTypes.object,
    form: PropTypes.object,
    isWaitForAudit: PropTypes.bool,
    isAuditEditable: PropTypes.bool,
  };

  render() {
    const { info, applicant, form, isWaitForAudit, isAuditEditable } = this.context;
    return (
      <div className='slide-expense-report-detail-pay'>
        <PayInfo
          expenseReportOID={info.expenseReportOID}
          userOid={applicant.userOID}
          selectInvoiceOIDs={[]}
          expenseReportInvoices={[]}
          clearSelectInvoiceOIDs={() => {}}
          formInfo={form}
          handleLineId={() => {}}
          operateMode={isWaitForAudit ? 'auditEdit' : 'readOnly'}
          firstMount
          expenseInfo={info}
          afterReload={() => {}}
          afterWriteOff={() => this.props.afterWriteOff(info)}
          pageFrom=''
          isAuditEditable={isAuditEditable}
        />
      </div>
    )
  }

}

export default SlideExpenseReportDetailPay;
